package vsy.buzzwordbingo.model.impl;

import java.util.ArrayList;
import java.util.List;

import vsy.buzzwordbingo.model.GameBoard;
import vsy.buzzwordbingo.model.Link;

public class BoardsBuilder {
	private List<Object> elements;
	
	public List<Link> getLinks() {
		List<Link> list = new ArrayList<Link>();
		for (Object elem : elements) {
			if (elem instanceof LinkBuilder) {
				list.add(((LinkBuilder)elem).createLink());
			}
		}
		return list;
	}
	
	public List<GameBoard> getBoards() {
		List<GameBoard> list = new ArrayList<GameBoard>();
		for (Object elem : elements) {
			if (elem instanceof BoardBuilder) {
				list.add(((BoardBuilder)elem).createBoard());
			}
		}
		return list;
	}
	
	public List<BoardBuilder> getBoardBuilders() {
		List<BoardBuilder> list = new ArrayList<BoardBuilder>();
		for (Object elem : elements) {
			if (elem instanceof BoardBuilder) {
				list.add((BoardBuilder)elem);
			}
		}
		return list;
	}
}
